package com.zsw.customer2.service;


import com.zsw.customer2.service.impl.TestServiceProducer2FallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 使用feign 微服务之间的通信
 *  熔断 FallbackFactory  可以获取熔断的原因
 */

@FeignClient(value = "serviceproducer2",fallbackFactory = TestServiceProducer2FallbackFactory.class)
public interface testServiceProducer2 {

    @GetMapping(value = "/client")
     String test();

    @GetMapping(value = "/hi/{id}")
    String hi(@PathVariable String id);

    @GetMapping(value = "/fallback")
    String expectFallback();
}
